import 'package:elastic_drawer/elastic_drawer.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:retrofit/retrofit.dart';

class ElasticDrawerDemo extends StatefulWidget {
  @override
  _ElasticDrawerDemoState createState() => _ElasticDrawerDemoState();
}

class _ElasticDrawerDemoState extends State<ElasticDrawerDemo> {
  @override
  Widget build(BuildContext context) {
    return WillPopScope(
        child: ElasticDrawer(
          mainColor: Colors.white,
          drawerColor: Color(0xff3C3F41),
          mainChild:
              Column(mainAxisAlignment: MainAxisAlignment.center, children: [
            Text('MAIN content'),
            TextButton(
              onPressed: () {
                Get.back();
              },
              child: Text('back'),
            )
          ]),
          drawerChild: Column(children: [
            Text('DRAWER content'),
            TextButton(
              onPressed: () {
                Get.back();
              },
              child: Text('back'),
            )
          ]),
        ),
        onWillPop: () async {
          return false;
        });
  }
}
